import Classif from '@/views/classif.vue'
import Detail from '@/views/detail.vue'
import Goods from '@/views/goods.vue'
import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Login from '@/views/login.vue'
import Register from '@/views/register.vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/register', component: Register,
    },
    {
      path: '/login', component: Login,
    },
    {
      path: '/goods/:cat_name', component: Goods,
    },
    {
      path: '/detail/:goods_id', component: Detail,
    },
    {
      path: '/index', component: Index,
      children:[
        {
          path: '/home', component: Home,
        },
        {
          path: '/classif', component: Classif,
        },
      ]
    },

  ],
})

export default router
